{% for message in get_flashed_messages(with_categories=True) %}
    <div style="margin-top: 5px" class="alert alert-{{ message[0] }}">
        <button type="button" class="close" data-dismiss="alert">&times;</button>
        {{ message[1] }}
    </div>
{% endfor %}